/*
package com.hualan.Filter;

import javax.servlet.*;
import java.io.IOException;

//在web.xml中配置过滤器
public class MyFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        System.out.println("");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {

        //前置拦截操作
        System.out.println("before");

        //放行,让目标处理这个请求(交给对应的servlet),若不执行放行语句则不放行
        filterChain.doFilter(servletRequest,servletResponse);

        //后置拦截操作
        System.out.println("after");

    }

    @Override
    public void destroy() {
        System.out.println("");
    }
}
*/
